Chapter 1
Introduction

 1.1 Listing of CAS systems tested
 1.2 Results
 1.3 Time and leaf size Performance
 1.4 Performance based on number of rules Rubi used
 1.5 Performance based on number of steps Rubi used
 1.6 Solved integrals histogram based on leaf size of result
 1.7 Solved integrals histogram based on CPU time used
 1.8 Leaf size vs. CPU time used
 1.9 list of integrals with no known antiderivative
 1.10 List of integrals solved by CAS but has no known antiderivative
 1.11 list of integrals solved by CAS but failed verification
 1.12 Timing
 1.13 Verification
 1.14 Important notes about some of the results
 1.15 Design of the test system

This report gives the result of running the computer algebra independent integration test.The download section in on the main webpage contains links to download the problems in plain text format used for all CAS systems. The number of integrals in this report is [ 96 ]. This is test number [ 47 ].

1.1 Listing of CAS systems tested

The following are the CAS systems tested:

  1. Mathematica 13.3.1 (August 16, 2023) on windows 10.
  2. Rubi 4.16.1 (Dec 19, 2018) on Mathematica 13.3 on windows 10
  3. Maple 2023.1 (July, 12, 2023) on windows 10.
  4. Maxima 5.47 (June 1, 2023) using Lisp SBCL 2.3.0 on Linux via sagemath 10.1 (Aug 20, 2023).
  5. FriCAS 1.3.9 (July 8, 2023) based on sbcl 2.3.0 on Linux via sagemath 10.1 (Aug 20, 2023).
  6. Giac/Xcas 1.9.0-57 (June 26, 2023) on Linux via sagemath 10.1 (Aug 20, 2023).
  7. Sympy 1.12 (May 10, 2023) Using Python 3.11.3 on Linux.
  8. Mupad using Matlab 2021a with Symbolic Math Toolbox Version 8.7 on windows 10.

Maxima and Fricas and Giac are called using Sagemath. This was done using Sagemath integrate command by changing the name of the algorithm to use the different CAS systems.

Sympy was run directly in Python not via sagemath.

1.2 Results

Important note: A number of problems in this test suite have no antiderivative in closed form. This means the antiderivative of these integrals can not be expressed in terms of elementary, special functions or Hypergeometric2F1 functions. RootSum and RootOf are not allowed. If a CAS returns the above integral unevaluated within the time limit, then the result is counted as passed and assigned an A grade.

However, if CAS times out, then it is assigned an F grade even if the integral is not integrable, as this implies CAS could not determine that the integral is not integrable in the time limit.

If a CAS returns an antiderivative to such an integral, it is assigned an A grade automatically and this special result is listed in the introduction section of each individual test report to make it easy to identify as this can be important result to investigate.

The results given in in the table below reflects the above.

System % solved % Failed
Rubi 100.00 ( 96 ) 0.00 ( 0 )
Mathematica 95.83 ( 92 ) 4.17 ( 4 )
Maple 51.04 ( 49 ) 48.96 ( 47 )
Fricas 51.04 ( 49 ) 48.96 ( 47 )
Mupad 51.04 ( 49 ) 48.96 ( 47 )
Sympy 43.75 ( 42 ) 56.25 ( 54 )
Giac 38.54 ( 37 ) 61.46 ( 59 )
Maxima 17.71 ( 17 ) 82.29 ( 79 )
Table 1.1: Percentage solved for each CAS

The table below gives additional break down of the grading of quality of the antiderivatives generated by each CAS. The grading is given using the letters A,B,C and F with A being the best quality. The grading is accomplished by comparing the antiderivative generated with the optimal antiderivatives included in the test suite. The following table describes the meaning of these grades.

grade

description

A

Integral was solved and antiderivative is optimal in quality and leaf size.

B

Integral was solved and antiderivative is optimal in quality but leaf size is larger than twice the optimal antiderivatives leaf size.

C

Integral was solved and antiderivative is non-optimal in quality. This can be due to one or more of the following reasons

  1. antiderivative contains a hypergeometric function and the optimal antiderivative does not.
  2. antiderivative contains a special function and the optimal antiderivative does not.
  3. antiderivative contains the imaginary unit and the optimal antiderivative does not.

F

Integral was not solved. Either the integral was returned unevaluated within the time limit, or it timed out, or CAS hanged or crashed or an exception was raised.

Table 1.2: Description of grading applied to integration result

Grading is implemented for all CAS systems. Based on the above, the following table summarizes the grading for this test suite.

System % A grade % B grade % C grade % F grade
Rubi 94.792 0.000 0.000 5.208
Mathematica 57.292 11.458 21.875 9.375
Sympy 29.167 6.250 8.333 56.250
Giac 27.083 6.250 0.000 66.667
Maxima 12.500 0.000 0.000 87.500
Fricas 10.417 29.167 6.250 54.167
Maple 7.292 0.000 38.542 54.167
Mupad 0.000 45.833 0.000 54.167
Table 1.3: Antiderivative Grade distribution of each CAS

The following is a Bar chart illustration of the data in the above table.

pict

The figure below compares the grades of the CAS systems.

pict

The following table shows the distribution of the different types of failures for each CAS. There are 3 types failures. The first is when CAS returns the input within the time limit, which means it could not solve it. This is the typical failure and given as F.

The second failure is due to time out. CAS could not solve the integral within the 3 minutes time limit which is assigned. This is assigned F(-1).

The third is due to an exception generated, indicated as F(-2). This most likely indicates an interface problem between sagemath and the CAS (applicable only to FriCAS, Maxima and Giac) or it could be an indication of an internal error in the CAS itself. This type of error requires more investigation to determine the cause.

System

Number failed

Percentage normal failure

Percentage timeout failure

Percentage exception failure

Rubi

0

0.00

0.00

0.00

Mathematica

4

100.00

0.00

0.00

Fricas

47

89.36

0.00

10.64

Maple

47

100.00

0.00

0.00

Mupad

47

0.00

100.00

0.00

Sympy

54

16.67

68.52

14.81

Giac

59

91.53

1.69

6.78

Maxima

79

98.73

0.00

1.27

Table 1.4: Failure statistics for each CAS

1.3 Time and leaf size Performance

The table below summarizes the performance of each CAS system in terms of time used and leaf size of results.

Mean size is the average leaf size produced by the CAS (before any normalization). The Normalized mean is relative to the mean size of the optimal anti-derivative given in the input files.

For example, if CAS has Normalized mean of \(3\), then the mean size of its leaf size is 3 times as large as the mean size of the optimal leaf size.

Median size is value of leaf size where half the values are larger than this and half are smaller (before any normalization). i.e. The Middle value.

Similarly the Normalized median is relative to the median leaf size of the optimal.

For example, if a CAS has Normalized median of \(1.2\), then its median is \(1.2\) as large as the median leaf size of the optimal.

System

Mean time (sec)

Maple

0.19

Maxima

0.28

Giac

0.39

Rubi

0.40

Fricas

0.48

Mathematica

1.16

Mupad

7.00

Sympy

9.82

Table 1.5: Time performance for each CAS

System

Mean size

Normalized mean

Median size

Normalized median

Maple

51.29

0.41

44.00

0.26

Maxima

128.29

1.10

72.00

1.08

Giac

331.35

1.75

147.00

0.94

Rubi

363.12

1.00

288.00

1.00

Sympy

435.00

2.78

110.50

0.48

Fricas

1192.80

3.44

349.00

2.21

Mathematica

2014.07

2.04

134.50

0.90

Mupad

2816.22

6.61

269.00

1.48

Table 1.6: Leaf size performance for each CAS

1.4 Performance based on number of rules Rubi used

This section shows how each CAS performed based on the number of rules Rubi needed to solve the same integral. One diagram is given for each CAS.

On the \(y\) axis is the percentage solved which Rubi itself needed the number of rules given the \(x\) axis. These plots show that as more rules are needed then most CAS system percentage of solving decreases which indicates the integral is becoming more complicated to solve.

pict

Figure 1.1: Solving statistics per number of Rubi rules used

1.5 Performance based on number of steps Rubi used

This section shows how each CAS performed based on the number of steps Rubi needed to solve the same integral. Note that the number of steps Rubi needed can be much higher than the number of rules, as the same rule could be used more than once.

pict

Figure 1.2: Solving statistics per number of Rubi steps used

The above diagram show that the precentage of solved intergals decreases for most CAS systems as the number of steps increases. As expected, for integrals that required less steps by Rubi, CAS systems had more success which indicates the integral was not as hard to solve. As Rubi needed more steps to solve the integral, the solved percentage decreased for most CAS systems which indicates the integral is becoming harder to solve.

1.6 Solved integrals histogram based on leaf size of result

The following shows the distribution of solved integrals for each CAS system based on leaf size of the antiderivatives produced by each CAS. It shows that most integrals solved produced leaf size less than about 100 to 150. The bin size used is \(40\).

pict

Figure 1.3: Solved integrals based on leaf size distribution

1.7 Solved integrals histogram based on CPU time used

The following shows the distribution of solved integrals for each CAS system based on CPU time used in seconds. The bin size used is \(0.1\) second.

pict

Figure 1.4: Solved integrals histogram based on CPU time used

1.8 Leaf size vs. CPU time used

The following shows the relation between the CPU time used to solve an integral and the leaf size of the antiderivative.

The result for Fricas, Maxima and Giac is shifted more to the right than the other CAS system due to the use of sagemath to call them, which causes an initial slight delay in the timing to start the integration due to overhead of starting a new process each time. This should also be taken into account when looking at the timing of these three CAS systems. Direct calls not using sagemath would result in faster timings, but current implementation uses sagemath as this makes testing much easier to do.

pict

Figure 1.5: Leaf size vs. CPU time. Full range

1.9 list of integrals with no known antiderivative

{59, 90, 94, 95, 96}

1.10 List of integrals solved by CAS but has no known antiderivative

Rubi

{}

Mathematica

{}

Maple

{}

Maxima

{}

Fricas

{}

Sympy

{}

Giac

{}

Mupad

{}

1.11 list of integrals solved by CAS but failed verification

The following are integrals solved by CAS but the verification phase failed to verify the anti-derivative produced is correct. This does not necessarily mean that the anti-derivative is wrong as additional methods of verification might be needed, or more time is needed (3 minutes time limit was used). These integrals are listed here to make it possible to do further investigation to determine why the result could not be verified.

Rubi

{}

Mathematica

{79, 83, 84, 86, 89}

Maple

{}

Maxima

Verification phase not currently implemented.

Fricas

Verification phase not currently implemented.

Sympy

Verification phase not currently implemented.

Giac

Verification phase not currently implemented.

Mupad

Verification phase not currently implemented.

1.12 Timing

The command AbsoluteTiming[] was used in Mathematica to obtain the elapsed time for each integrate call. In Maple, the command Usage was used as in the following example

cpu_time := Usage(assign ('result_of_int',int(expr,x)),output='realtime'

For all other CAS systems, the elapsed time to complete each integral was found by taking the difference between the time after the call completed from the time before the call was made. This was done using Python’s time.time() call.

All elapsed times shown are in seconds. A time limit of 3 CPU minutes was used for each integral. If the integrate command did not complete within this time limit, the integral was aborted and considered to have failed and assigned an F grade. The time used by failed integrals due to time out was not counted in the final statistics.

1.13 Verification

A verification phase was applied on the result of integration for Rubi and Mathematica.

Future version of this report will implement verification for the other CAS systems. For the integrals whose result was not run through a verification phase, it is assumed that the antiderivative was correct.

Verification phase also had 3 minutes time out. An integral whose result was not verified could still be correct, but further investigation is needed on those integrals. These integrals were marked in the summary table below and also in each integral separate section so they are easy to identify and locate.

1.14 Important notes about some of the results

1.15 Design of the test system

The following diagram gives a high level view of the current test build system.